package gongqing.views.adapters;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xkh.xkh.R;

import com.xkh.xkh.MyApplication;

/**
 * 选择设备
 * Created by 凯 on 2015/11/10.
 */
public class DevTypeChooseAdapter extends BaseAdapter {

    String[] devtype;

    public void setDevtype(String[] devtype) {
        this.devtype = devtype;
    }

    //    String[] devTypeCode = MyApplication.nshare().getResources().getStringArray(R.array.devTypeCode);

    @Override
    public int getCount() {
        return devtype.length;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        convertView = View.inflate(MyApplication.share(),R.layout.item_spinner,null);
        TextView tv_item = (TextView) convertView.findViewById(R.id.item);
        tv_item.setText(devtype[position]);
        return convertView;
    }
}
